import service from '@/utils/request'
/**
 * 获取用户所有部门信息
 * @returns
 */
export function getdepartments() {
  return service({
    url: '/company/department',
    method: 'get'
  })
}

/**
 * 删除某部门
 * @param {部门id} id
 * @returns
 */
export function deldepartments(id) {
  return service({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

/**
 * 获取员工列表
 */
export function getEmployeeSimple() {
  return service({
    url: '/sys/user/simple'
  })
}

/**
 * 添加部门
 * @param {} data
 * @returns
 */
export function adddepartments(data) {
  return service({
    url: '/company/department',
    method: 'POST',
    data
  })
}

/**
 * 查询部门详情
 * @param {要查询的部门id} id
 * @returns
 */
export function queryDepartmentsMeassage(id) {
  return service({
    url: `/company/department/${id}`
  })
}

export function changeDepartments(data) {
  return service({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
